	
	$(function(){
			$('#table').datagrid({
				title:'理财方式列表',
				width:1230,
				height:400,
				nowrap : false,
		        triped : true,
		        collapsible : false,
				idField : 'id',
				url:base+'/login/managFinaWay!searchFinaList.shtml',
				frozenColumns:[[
	                {field:'ck',checkbox:true}
	                
				]],
				columns:[[
			
					{field:'id',title:'下拉值的id',width:120,align : 'center',sortable:false
					},
					{field:'name',title:'下拉值名字',align : 'center',width:150,sortable:true}
				]],
				toolbar:[{
					id:'btnadd',
					text:'新增',
					iconCls:'icon-add',
					handler:function(){
						$(this).attr("href", base+'/back/addManagFinaWay.jsp');
					}
				},{
					id:'btncut',
					text:'删除',
					iconCls:'icon-cut',
					handler:function(){
						var records = $('#table').datagrid("getSelections");
						var ids = '';
						if (null == records || records == "") {
							alert('请选择要删除的记录');
							return;
						}
						for (var i = 0; i < records.length; i++) {
							if (records[i].id == undefined
									|| records[i].id == "undefined") {

								alert('此条记录已不存在');
								return;
							}
							ids += records[i].id;
							ids += ',';
						}
							var url1 = base+'/login/managFinaWay!deleteByIds.shtml';

						$.ajax({
									url : url1,
									data : "ids=" + ids,
									success : function(msg) {

										var obj = eval('(' + msg + ')');
										var result = obj[0]["message"];
										alert(result);
										$('#table').datagrid("reload");
									}
								});
					}
				}]
			});
			
		});
		
	
	
	
	
	

